﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JLL.China.Web.Areas.Portal.Models.AdminModel>" %>

<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {

    }
</script>

<!--  start step-holder -->
    <div id="step-holder">
        <div class="step-no">
            1</div>
        <div class="step-dark-left">
            Administrator Details</div>
        <div class="step-dark-Round">
            &nbsp;</div>
        <div class="clear">
        </div>
    </div>
    <!--  end step-holder -->
    <!-- start id-form -->
    <% using (Html.BeginForm("Create", "Admin", FormMethod.Post, new { id = "formID", @class = "validateforms" }))
       { %>
    <% = Html.HiddenFor(x => x.Admin.ID)%>
    
    <input type="hidden" name="Admin.IsSupperAdmin" value="false"/>
    <table border="0" cellpadding="0" cellspacing="0" class="tbl-form">
        <!-- start admin profile -->
        <tr>
            <th  width="100px">
                <span class="mandate">*</span> User Name:
            </th>
            <td>
                <%= Html.TextBoxFor(model => model.Admin.UserName, new { id = "username", name = "username", @class = "validate[required] inp-form" })%>
                 <a class="checkitem"></a>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <th  width="100px">
                <span class="mandate">*</span> Password:
            </th>
            <td>
                <% if (Model.Admin.ID != Guid.Empty)
                   {%>
                <%= Html.PasswordFor(model => model.Admin.Password, new { @class = "inp-form" })%>
                <%}
                   else
                   { %>
                <%= Html.PasswordFor(model => model.Admin.Password, new { @class = "validate[required] inp-form" })%>
                <%} %>
            </td>
            <td>
            </td>
        </tr>
        
        <tr>
            <th  name="status" id="status" class="required" width="100px">
                <span class="mandate">*</span> Status:
            </th>
            <td>
                <div class="select_holder">
                    <%=Html.DropDownListFor(m => m.Admin.IsActive, new List<SelectListItem>
                     {
                        new SelectListItem{Selected = true, Text="Active", Value = "true" }, 
                        new SelectListItem{Selected = false, Text="Inactive", Value = "false" },
                     }, new { @class = "chzn-nosearch chz" })%>
                </div>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <th  name="status" id="Th1" class="required" width="100px">
                <span class="mandate">*</span> Group:
            </th>
            <td>
                <div class="select_holder">
                    <%=Html.DropDownListFor(m => m.Admin.GroupFid, new SelectList(Model.Groups, "MemberGroup_ID","GroupName")
                                          , new { @class = "chzn-nosearch chz" })%>
                </div>
            </td>
            <td>
            </td>
        </tr>
        <!-- end admin -->
        <tr>
            <td colspan="3">
                &nbsp;
            </td>
        </tr>
        <!-- start Modules List -->
       <%-- <tr>
            <th >
                 Access Control:
            </th>
            <td>
                <div class="scrollbox" >
                    <ul>
                        <% 
                            for (int i = 0; i < this.Model.AllModules.Count; i++)
                            {
                        %>
                        <li>
                            <% if (Model.AllModules[i].IsChecked)
                               { %>
                            <input type="checkbox" class="validate[minCheckbox[1]]" name="SelectedModules" value="<%= this.Model.AllModules[i].ID %>"
                                checked="checked" />
                            <%}
                               else
                               { %>
                            <input type="checkbox" class="validate[minCheckbox[1]]" name="SelectedModules" value="<%= this.Model.AllModules[i].ID %>" />
                            <%} %>
                            <%=this.Model.AllModules[i].Name%>
                        </li>
                        <% }%>
                    </ul>
                </div>
                <a class="check" onclick="$(this).parent().find(':checkbox').attr('checked', true);">
                    Select All</a> / <a class="check" onclick="$(this).parent().find(':checkbox').attr('checked', false);">
                        Unselect All</a>
            </td>
            <td>
            </td>
        </tr>--%>
        <!-- end Modules List -->
         

        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <th>
                &nbsp;
            </th>
            <td >
                <input type="submit" value="Submit"  onclick="checkForm();" class="buttons" style="margin-right:8px;float:right" />
                <input type="reset" value="Reset"  class="buttons" style="margin-right:8px;float:right"/>
            </td>
            <td style="width: 42%;">
            </td>
        </tr>
    </table>
    <%} %>
    <!-- end id-form  -->